package com.dyh.quickdemo.bizDemo.Eigenvector;

import org.apache.commons.lang3.time.DateUtils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/*
@Author=Joey Wheeler
@Date=2021/2/24 14:25
*/
public class M2 {

    public static void main(String[] args) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        Date fullStart = sdf.parse("2021-02-24 00:00:00");
        Date fullEnd = new Date();

        for (Date start = fullStart; start.before(fullEnd);
             start= DateUtils.addMinutes(start,1)){
            Date end = DateUtils.addMinutes(start,1);
            if (end.after(fullEnd)){
                end = fullEnd;
                System.out.println(sdf.format(start)+"->"+sdf.format(end));
                break;
            }
            System.out.println(sdf.format(start)+"->"+sdf.format(end));


        }
    }
}
